package com.yf.controller;

import com.yf.common.Resp;
import com.yf.entity.Student;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/*********************************************************
 ** helloController
 ** <br><br>
 ** @ClassName: HelloController
 ** @author: yangfeng
 ** @date: 2024/10/14 8:53
 ** @version: 1.0.0
 *********************************************************/
@RestController
@Slf4j
@RequestMapping("/hello")
public class HelloController {
    @GetMapping("/sayHello")
    public String sayHello(String name) {
        return "Hello " + name;
    }
    @PostMapping("/addStudent")
    public Resp addStudent(@Valid @RequestBody Student student){
        return Resp.ok(student);
    }
}
